package com.graduation.smartparkingplatform.Dao;

import com.graduation.smartparkingplatform.Pojo.User;
import com.graduation.smartparkingplatform.Pojo.UserNA;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
  public User findUser(@Param("username") String username, @Param("password") String password);

  public Boolean visitorLog(
      @Param("userId") Integer userId,
      @Param("userName") String username,
      @Param("operation") String operation,
      @Param("userIp") String ipAddress,
      @Param("userCity") String city,
      @Param("deviceType") String device,
      @Param("userBrowsers") String browsers,
      @Param("visitTime") String nowTime);

  public List<UserNA> getUserList();

  public List<UserNA> searchUser(@Param("userName") String userName);

  public UserNA getUserMessage(@Param("userId") Integer userId);

  public Boolean addUser(
      @Param("orgId") Integer orgId,
      @Param("userName") String userName,
      @Param("password") String password,
      @Param("nickName") String nickName,
      @Param("telphone") String telphone,
      @Param("email") String email,
      @Param("admin") Boolean admin,
      @Param("nowTime") String nowTime);

  public Boolean changeInfo(
      @Param("userId") Integer userId,
      @Param("orgId") Integer orgId,
      @Param("userName") String userName,
      @Param("password") String password,
      @Param("nickName") String nickName,
      @Param("telphone") String telphone,
      @Param("email") String email,
      @Param("nowTime") String nowTime);

  public Boolean changeUserStatus(@Param("userId") Integer userId, @Param("status") Boolean status);

  public Boolean changeUserAdmin(
      @Param("userId") Integer userId, @Param("adminStatuts") Boolean adminStatuts);

  public Boolean deleteUser(@Param("userId") Integer userId);

  public Integer Count_user();

  public Integer Count_visitor();
}
